package com.vcredit.creditcat.enumtype;


public enum AbilityEnum {

	Normal(1L,"标准卡",1000L,0,"完成首次登录"),
	Silver(2L,"银卡",1500L,1,"累计贷款或办卡1次"),
	Gold(3L,"金卡",2000L,3,"累计贷款或办卡3次"),
	Platinum(4L,"白金",2500L,5,"累计贷款或办卡5次"),
	Diamond(5L,"钻石卡",3000L,8,"累计贷款或办卡8次"),
	Black(6L,"黑卡",10000L,20,"累计贷款或办卡20次");
	
	private Long code;
	private String desc;
	private Long amt;
	private int conditionCount;
	private String conditionDesc;
	
	private AbilityEnum(Long code, String desc, Long amt) {
		this.code = code;
		this.desc = desc;
		this.amt = amt;
	}
	
	
	private AbilityEnum(Long code, String desc, Long amt, int conditionCount, String conditionDesc) {
		this.code = code;
		this.desc = desc;
		this.amt = amt;
		this.conditionCount = conditionCount;
		this.conditionDesc = conditionDesc;
	}


	public long getCode() {
		return code;
	}
	public String getDesc() {
		return desc;
	}
	public Long getAmt() {
		return amt;
	}
		
	public int getConditionCount() {
		return conditionCount;
	}

	public void setConditionCount(int conditionCount) {
		this.conditionCount = conditionCount;
	}

	public String getConditionDesc() {
		return conditionDesc;
	}

	public void setConditionDesc(String conditionDesc) {
		this.conditionDesc = conditionDesc;
	}


	public static Long getAmtByIndex(Long index) {
          for (AbilityEnum c : AbilityEnum.values()) {
              if (c.getCode() == index) {
                  return c.getAmt();
              }
          }
          return null;
      }
}
